<?php

namespace api\controller;


use common\controller\VerifyController;
use common\service\SupplierService;
use think\Request;

class SupplierController extends VerifyController
{
    /** @var SupplierService */
    private $supplierService;

    public function __construct()
    {
        parent::__construct();
        $this->supplierService = new SupplierService();
    }

    /**
     * 获取客户列表
     * @param Request $request
     * @return \think\Response
     * @throws \Exception
     */
    public function select(Request $request)
    {
        $resData = $this->supplierService->select($request->param(), $request->tenantId);
        return json(success_response('', $resData));
    }

    /**
     * 查询供应商详情
     * @param Request $request
     * @return \think\Response
     * @throws \Exception
     */
    public function findSupplier(Request $request)
    {
        $resData = $this->supplierService->findSupplier($request->param());
        return json(success_response('', $resData));
    }

    /**
     * 等待签署供应/客户查询
     * @return \think\Response
     * @throws \Exception
     */
    public function waitForSignSelect(Request $request)
    {
        $param = $request->param();
        $resData = $this->supplierService->waitForSignSelect($param);
        return json(success_response('', $resData));
    }

}